package by.grsu.hdm.media;

import by.grsu.hdm.media.file.MediaFile;



public class RemoteMediaControler {

	private MediaPlayer mediaPlayer;

	public static final int PLAY_SIGNAL = 0;
	public static final int PAUSE_SIGNAL = 1;
	public static final int STOP_SIGNAL = 2;

	public RemoteMediaControler(MediaPlayer mediaPlayer) {
		this.mediaPlayer = mediaPlayer;
	}

	public void onPlayButtonClick(MediaFile mediaFile) {
		if (mediaPlayer != null) {
			mediaPlayer.handleRemoteSignals(PLAY_SIGNAL, mediaFile);
		}
	}

	public void onPauseButtonClick(MediaFile mediaFile) {
		if (mediaPlayer != null) {
			mediaPlayer.handleRemoteSignals(PAUSE_SIGNAL, mediaFile);
		}
	}

	public void onStopButtonClick(MediaFile mediaFile) {
		if (mediaPlayer != null) {
			mediaPlayer.handleRemoteSignals(STOP_SIGNAL, mediaFile);
		}
	}

}
